<?php

error_reporting(E_ALL);
ini_set('display_errors', true);

define('DS', DIRECTORY_SEPARATOR);
define('LIB_DIR', 'libraries/');
define('APP_DIR', 'application/');

spl_autoload_register('autoloader');

$include_paths = array();

function autoloader($class) {
	global $include_paths;

	$filepath = strtolower(str_replace('_', DS, $class)).'.php';

	foreach ($include_paths as $path) {
		if (file_exists($path.$filepath)) {
			include_once($path.$filepath);
			return true;
		}
	}

	return false;
}

$include_paths[] = LIB_DIR;

require('application/bootstrap.php');